package com.cody.dao;

import com.cody.entity.Answer;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author Cody
 * @date 2021/4/6 - 20:28
 */
public interface AnswerDao {


    /**
     * 在教师端页面显示未回答的问题，即isanwer为零
     * 在问题下面显示已经存在的回答 即isanwer为1
     * 涉及三个表   老师 问题 回答
     * 通过session查询出教师的number
     * 再通过number查询出未回答的问题进行回答
     *
     * @param answerRespondId
     * @return
     */
    List<Answer> queryAllAnswerByAnswerRespondId(@Param("answerResponderId") String answerRespondId);

    List<Answer> queryAnswerByKeyword(@Param("Keyword") String keyword);

    Answer queryAllAnswerByAnswerId(@Param("AnswerId") Integer answerId);

    List<Answer> queryAllAnswer();

    List<Answer> queryAllAnswerByQuestionId(@Param("QuestionId") Integer questionId);

    boolean insertAnswer(@Param("answer") Answer answer);

    boolean delAnswerByAnswerId(@Param("AnswerId") Integer answerId);

    boolean updAnswerInfo(@Param("answer") Answer answer);

    //测试
    List test();
}
